VTIMES

Section: C Library Functions (3)
Index Return to Main Contents

BSD mandoc
BSD 4  

NAME

vtimes - get information about resource utilization  

SYNOPSIS

Fd #include <sys/vtimes.h> Fn vtimes struct vtimes *par_vm struct vtimes *ch_vm  

DESCRIPTION

Bf -symbolic This interface is obsoleted by getrusage(2). It is available from the compatibility library, libcompat. Ef

The Fn vtimes function returns accounting information for the current process and for the terminated child processes of the current process. Either Fa par_vm or Fa ch_vm or both may be 0, in which case only the information for the pointers which are non-zero is returned.

After the call, each buffer contains information as defined by the contents of the include file /usr/include/sys/vtimes.h

struct vtimes {
        int     vm_utime;       /* user time (*HZ) */
        int     vm_stime;       /* system time (*HZ) */
        /* divide next two by utime+stime to get averages */
        unsigned vm_idsrss;     /* integral of d+s rss */
        unsigned vm_ixrss;      /* integral of text rss */
        int     vm_maxrss;      /* maximum rss */
        int     vm_majflt;      /* major page faults */
        int     vm_minflt;      /* minor page faults */
        int     vm_nswap;       /* number of swaps */
        int     vm_inblk;       /* block reads */
        int     vm_oublk;       /* block writes */
};

The Fa vm_utime and Fa vm_stime fields give the user and system time respectively in 60ths of a second (or 50ths if that is the frequency of wall current in your locality.) The Fa vm_idrss and Fa vm_ixrss measure memory usage. They are computed by integrating the number of memory pages in use each over CPU time. They are reported as though computed discretely, adding the current memory usage (in 512 byte pages) each time the clock ticks. If a process used 5 core pages over 1 cpu-second for its data and stack, then Fa vm_idsrss would have the value 5*60, where Fa vm_utime+vm_stime would be the 60. The Fa Vm_idsrss argument integrates data and stack segment usage, while Fa vm_ixrss integrates text segment usage. The Fa Vm_maxrss function reports the maximum instantaneous sum of the text+data+stack core-resident page count.

The Fa vm_majflt field gives the number of page faults which resulted in disk activity; the Fa vm_minflt field gives the number of page faults incurred in simulation of reference bits; Fa vm_nswap is the number of swaps which occurred. The number of file system input/output events are reported in Fa vm_inblk and Fa vm_oublk These numbers account only for real I/O data supplied by the caching mechanism is charged only to the first process to read or write the data.  

SEE ALSO

time(2), wait3(2), getrusage(2)  

HISTORY

The Fn vlimit function appeared in BSD 4.2


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
HISTORY

This document was created by man2html, using the manual pages.
Time: 16:28:56 GMT, April 18, 2022